(deftemplate grocery-list 
	(multislot list (type STRING) )
)

(watch all)

(reset)

( defrule grocery-list-rule
	(declare (salience -100))
	(grocery-list (list ? ? ?) )
	=>
	(printout t "Found the right grocery list to match " crlf)
)

( defrule grocery-list-multilist
	(grocery-list (list $?grocList) )
	=>
	(printout t "Found the right grocery list to buy: " $?grocList crlf)
)

( defrule grocery-list-multilist-match
	(grocery-list (list $? yoghurt $?) )
	=>
	(printout t "This grocery list includes yoghurt: " crlf)
)

(assert (grocery-list (list yoghurt veggies meat) ) )

(agenda)

(run)